
import * as utc from "../util/utc.js";
import {createOstiaSST, createOstiaSSTA} from "./ostia.js";
import {createRTGSST, createRTGSSTA} from "./rtg.js";


const OSTIA_SWITCH_DATE = utc.date({year: 2019, month: 12, day: 15});

function isOstia(date) {
    return date === "current" || utc.date(date) >= OSTIA_SWITCH_DATE;
}

export function createSSTLayer(attr) {
    return isOstia(attr.time_cursor) ? createOstiaSST(attr) : createRTGSST(attr);
}

export function createSSTALayer(attr) {
    return isOstia(attr.time_cursor) ? createOstiaSSTA(attr) : createRTGSSTA(attr);
}
